home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu677.dms / pu677.adf / Dsp3210info.txt < prev    next >
Text File  |  1993-05-13  |  12KB  |  276 lines

  1. DSP3210 Overview
  2. ----------------
  3.  
  4. The DSP3210 is a full 32-bit floating point DSP implemented in .9 micron CMOS.
  5. It provides many advantages over fixed point DSPs such as the Motorola 56000.
  6. Some of the main features of the DSP3210 include:
  7.  
  8.   * 32-bit floating point arithmetic.
  9.   * 32-bit addressing.
  10.   * Large (8k) on-chip, zero wait-state memory.
  11.   * Single cycle instructions (for up to 33 Mflops).
  12.   * Share bus with Motorola or Intel style CPU.
  13.   * Serial I/O with DMA transfer conters for up to 25 Mbits/second transfer:
  14.       Serial data transfers occur without processor intervention.
  15.       Cycles are stolen when necessary.
  16.       DMA control for serial in and serial out.
  17.   * Barrel Shifter for bit manipulation in graphics or data encryption.
  18.   * Both mu-law and A-law encoding.
  19.   * Bit I/O general purpose 8-bit I/O port for control of external hardware.
  20.   * Programmable 32-bit timer for interval timing, rate generation, event
  21.     counting or waveform generation.
  22.   * Fully vectored interrupt structure with hardware context save:
  23.       Allows very fast interrupt processing, up to 2 million/second.
  24.   * Low power CMOS design.
  25.  
  26. No special programming is required on the DSP3210 to implement floating point
  27. algorithms, or to process signals with a much larger dynamic range (in excess
  28. of 1500 dB as opposed to < 300 dB for fixed point). The DSP3210 is also
  29. designed to share a host memory bus with either a Motorola or Intel style CPU.
  30. This greatly reduces system cost by removing the requirement for expensive
  31. fast local memory for the DSP. This also removes any practical restrictions on
  32. program or data size. A large on-chip cache (8k) combined with software that
  33. intelligently utilizes the cache allows the DSP3210 to execute complex signal
  34. processing algorithms without expensive local memory. All instructions execute
  35. in a single cycle (four clock periods> 80 ns for a 50 MHz part or 60 ns for a
  36. 66 MHz part) and includes all floating point normalization (which is performed
  37. automatically). A single instruction may have two floating point operations:
  38. a floating point multiplication and a floating point addition. The DSP3210
  39. also supports up to four memory accesses in a single instruction cycle (quad-
  40. word transfer). The DSP3210 architecture features seven functional units:
  41.  
  42.   * Control Arithmetic Unit (CAU)
  43.   * Data Arithmetic Unit (DAU)
  44.   * On-chip memory (RAM0, RAM1, Boot ROM)
  45.   * Bus Interface
  46.   * Serial I/O (SIO)
  47.   * DMA Controller (DMAC)
  48.   * Timer/Status Control (TSC)
  49.  
  50.  
  51. The Control Arithmetic Unit
  52. ---------------------------
  53.  
  54. The CAU is responsible for address calculation, branching control and all 16
  55. and 32-bit integer logic and arithmetic operations. It is a RISC core
  56. consisting of a 32-bit Arithmetic Logic Unit (ALU), a 32-bit Program Counter
  57. (PC), 22 32-bit general purpose registers (r0-r22) and a 32-bit barrel
  58. shifter. This core executes instructions at up to 16.7 million instructions
  59. per second. There are special register considerations in the CAU:
  60.  
  61.   r0              hardwired to 0 (always)
  62.   r1-r14          DA instruction memory reference (X,Y,Z) pointer registers
  63.   r15-r19         DA instruction memory reference (X,Y,Z) increment registers
  64.   r20             used by error exception facility to store old pc
  65.   r21             stack pointer (sp)
  66.   r22             pointer to the exception vector table (evtp)
  67.  
  68. The CAU provides the following branching and control instructions:
  69.  
  70.   if (COND) goto {N,rB,rB+N}       Conditional branch based on flags
  71.   if (rM-->=0) goto {N,rB,rB+N}    Conditional branch using loop counter
  72.   goto {N,rB,rB+N,M,rB+M}          Unconditional branch
  73.   nop                              No operation
  74.   call {N,rB,rB+N,M}(rM)           Call subroutine
  75.   return {rM}                      Return from subroutine
  76.   do K,{L,rM}                      Do next K+1 instruction(s) L+1 or (rM+1)
  77.                                    times. K=0,1,2...127; L=rM=0,1,2...2047
  78.   dolock K,{L,rM}                  Signals interlocked bus transfer
  79.   doblock {L,rM}                   Signals quad-word transfers
  80.   ireturn                          Return from interrupt
  81.   sftrst                           Soft-reset; changes error level to base
  82.                                    level; encoded as spc=(byte)r0
  83.   waiti                            Wait for interrupt; encoded as spc=(long)r0
  84.  
  85.   where:  rB = pc, r0-r22
  86.           rM = r1-r22
  87.           N = 16-bit unsigned integer
  88.           M = 24-bit unsigned integer
  89.           COND = one of the DSP3210 condition codes (refer to DSP3210 manual)
  90.  
  91.  
  92. The Data Arithmetic Unit
  93. ------------------------
  94.  
  95. The DAU consists of a 32-bit floating point multiplier, a 40-bit floating
  96. point adder, four 40-bit floating point accumulators (a0-a3), a clip test
  97. register (ctr), and a control register (dauc). The multiplier and adder
  98. operate in parallel to perform up to 16.7 million computations per second
  99. (12.5 million for a 50 MHz part) of the form (a=b+c*d), also known as a
  100. multiply-accumulate. The DAU contains a four stage pipeline which is visible
  101. to the application programmer. The DAU supports the following floating point
  102. formats:
  103.  
  104.   Single precision (32-bit) in both DSP32 and IEEE format
  105.   Extended single precision (40-bit) (uses 8 mantissa guard bits)
  106.  
  107. Single instruction data type conversions are done in the DAU hardware:
  108.  
  109.   DSP32 and IEEE 32-bit floating point
  110.   16/32-bit integer
  111.   8-bit unsigned
  112.   mu-law and A-law
  113.  
  114. The DAU has a number of special instructions to greatly simplify data type
  115. conversions and other common operations:
  116.  
  117.   [Z=] aN = ic(Y)      Input conversion mu-law, A-law, 8-bit linear to float.
  118.   [Z=] aN = oc(Y)      Output conversion float to mu-law, A-law, 8-bit linear.
  119.   [Z=] aN = float16(Y) 16-bit integer to float.
  120.   [Z=] aN = float32(Y) 32-bit integer to float.
  121.   [Z=] aN = int16(Y)   Float to 16-bit integer (round or truncate, dauc[4]).
  122.   [Z=] aN = int32(Y)   Float to 32-bit integer (round or truncate, dauc[4]).
  123.   [Z=] aN = round(Y)   Round to nearest, float(40) to float(32).
  124.   [Z=] aN = ifalt(Y)   Condidional assignment/memory write.
  125.   [Z=] aN = ifaeq(Y)   Conditional assignment/memory write.
  126.   [Z=] aN = ifagt(Y)   Conditional assignment/memory write.
  127.   [Z=] aN = dsp(Y)     IEEE to DSP format conversion.
  128.   [Z=] aN = ieee(Y)    DSP to IEEE format conversion.
  129.   [Z=] aN = seed(Y)    32-bit to 32-bit reciprocal seed.
  130.  
  131. Where [Z=] indicates that condition codes may be set. Note that Y may not be
  132. a0-a3 for the dsp() special function.
  133.  
  134.  
  135. Addressing Modes
  136. ----------------
  137.  
  138. DSP3210 assembler language exhibits a syntax very similar to 'C'. The notation
  139. conventions are as follows: a0-a3 are the accumulators (DAU), and r0-r22 are
  140. the CAU registers. Instructions take the following appearance:
  141.  
  142.   r2 = (long)r1      ; CAU register direct: store the contents of r1 in r2
  143.   r1 = (long)*r1     ; store value pointed to by r1 in r2
  144.   r1 = (long)r1 + 1  ; increment r1 by 1
  145.   *r2++ = (long)r1   ; postmodify increment r2 after storing r1 there (in *r2)
  146.   r3 = (long)r1 + r2 ; add two numbers in r1, r2: store result in r3
  147.   r3 = (long)*r1++r2 ; post modify increment r1 by r2: store the result in r3
  148.   a2 = a2 + *r2 * a3 ; use that pipeline!
  149.  
  150.  
  151. The following table lists the various addressing modes supported by the
  152. DSP3210:
  153.  
  154. ------------------------------------------------------------------------------
  155.                                        Instruction Type
  156. Addressing Mode         CA Data      CA Data      CA Arithmetic/  DA M/A &
  157.                         Move Group   Move Group   Logic Group     Special Func
  158.                         (CAU Reg)    (I/O Reg)
  159. ------------------------------------------------------------------------------
  160. Short Immediate         Yes
  161. 24-bit Immediate        Yes
  162. Memory Indirect         Yes
  163. CAU Register Direct     Yes          Yes          Yes
  164. IO Register Direct      Yes
  165. DAU Register Direct     Yes                                       Yes
  166. Register Indirect       Yes          Yes                          Yes
  167. Register Indirect with  Yes          Yes                          Yes
  168. Postmodification
  169. ------------------------------------------------------------------------------
  170.  
  171.  
  172. Latency Issues
  173. --------------
  174.  
  175. The most difficult aspect of programming the DSP3210 is being aware of latency
  176. in the instruction pipeline. There are four cases in the DAU when the pipeline
  177. affects latency. The cases are:
  178.  
  179. 1. DA Memory Writes. When a DA instruction specifies a write to memory, the
  180.    value written is not available to be read from that location until four
  181.    instructions later (a three instruction latency). For example:
  182.  
  183.   *r3 = a0 = a0     ; instruction 1
  184.   *r3 = a3 = a3     ; instruction 2
  185.   .                 ; instruction 3
  186.   .                 ; instruction 4
  187.   a1 = *r3          ; instruction 5
  188.  
  189. The value read in instruction 5 is the value written in instruction 1, not
  190. instruction 2. Instructions 3 and 4 are latent instructions for instruction 1
  191. and instructions 3, 4 and 5 are latent for instruction 2.
  192.  
  193. 2. Accumulator as Multiplier Input. When an accumulator is used as an input to
  194.    the multiplier, its value is established no sooner than three instructions
  195.    prior to the multiply instruction (a two instruction latency). Note that
  196.    this also applies to an accumulator using the X field of an instruction
  197.    of the form:
  198.  
  199.      [Z=] aN = [-]Y {+,-}X
  200.  
  201. For example:
  202.  
  203.   a0 = a0 + *r1**r2     ; instruction 1
  204.   a0 = a0 + a1          ; instruction 2
  205.   .                     ; instruction 3
  206.   a2 = a0 * a0          ; instruction 4
  207.   a1 = a2 + a0          ; instruction 5
  208.  
  209. The value of a0 used in instruction 4 is calculated in instruction 1. The
  210. value of a0 used in instruction 5 is calculated in instruction 4 since there
  211. is no latency effect on accumulators used as inputs to the adder.
  212.  
  213. 3. Branching. When a CA Control Group instruction of the form if()goto, call,
  214.    return, goto is executed, the instruction immediately following is also
  215.    executed before the branch occurs. This is commonly referred to as a
  216.    delayed branch. The ireturn instruction is different, and execution of the
  217.    base-level program resumes in the following instruction cycle. For example:
  218.  
  219.   if(eq) goto over      ; instruction 1
  220.   r1 = 3                ; instruction 2
  221.   .                     ; instruction 3
  222.  
  223. Instruction 2 is executed even if the condition is true and the branch is
  224. taken. If this is undesirable, a nop can be placed after the branch
  225. instruction, or if possible, the instructions can be rearranged. Because of
  226. this latency, a complex situation arises if successive branch instructions are
  227. coded in the following manner:
  228.  
  229.   goto A                ; instruction 1
  230.   goto B                ; instruction 2
  231.  
  232.   A:
  233.   .
  234.   B:
  235.   .
  236.   C:
  237.   .
  238.  
  239. The order of execution is instruction 1, instruction 2, A, B. If the
  240. instruction at A is not a goto, execution continues from B. If the instruction
  241. at A is goto C, the order of execution is instruction 1, instruction 2, A, B,
  242. C, and execution continues from C. Successive branch instructions are useful
  243. in some applicationss.
  244.  
  245. 4. Conditional Branching on DAU Conditions. A DAU conditional branch or
  246.    conditional arithmetic/logic instruction is established by the last DA
  247.    instruction that affects DAU flags no sooner than four instructions prior
  248.    to the test (a three instruction latency):
  249.  
  250.   a0 = a0 + a1          ; instruction 1
  251.   a2 = a0 * a2          ; instruction 2
  252.   .                     ; instruction 3
  253.   .                     ; instruction 4
  254.   if(agt) goto next     ; instruction 5
  255.   .                     ; instruction 6 (latent instruction)
  256.  
  257. The condition tested in instruction 5 is established by instruction 1, not
  258. instruction 2. Because of this latency effect, use the zero-latency ifalt(),
  259. ifagt() and ifaeq() functions where possible (see DA Special Instructions).
  260. The DA condition tested by these conditional accumulator loads is established
  261. by the last DA instruction that affected the DAU flags.
  262.  
  263.  
  264. Ref.
  265.  
  266. "DSP3210 Digital Signal Processor. The Multimedia Solution", Information
  267. Manual. AT&T, September 1991 printing.
  268.  
  269. "VCOS Multimedia Development Kit, Technical Reference". AT&T Release 1.0,
  270. March 1992 printing.
  271.  
  272. DSP3210 Support Software Toolkit Manual, Release 1.3
  273.  
  274. DSP3210 Support Software Library Manual, Release 1.3
  275.  
  276.